1. Field of Application
The present invention relates to a microcomputer which operates in a condition of being built into an apparatus that is at least partially controlled by the microcomputer, with the microcomputer including a CPU (Central Processing Unit) and a ROM (Read-Only Memory) having stored therein a user program which is executed by the CPU.
The invention further relates to a vehicle ECU (Electronic Control Unit) which incorporates such a microcomputer.
2. Description of Prior Art
FIG. 17 is a general block diagram showing the basic elements of a prior art type of microcomputer which is used in a condition of being built into an apparatus that is controlled by the microcomputer. The microcomputer 1 is based on a CPU 2, and includes a ROM 3 having stored therein a program that has been generated by a user and which is executed by the CPU 2, and peripheral circuits which perform various operations and are accessed through execution of the aforementioned program by the CPU 2. The peripheral circuits can for example include a RAM (Random Access Memory) 4 which is used as a work area by the CPU 2, a DMA (Direct Memory Access) controller 5 for performing DMA transfers of data, an interrupt controller 6 for controlling the supply of interrupts to the CPU 2, a watchdog timer 7 which monitors the operating condition of the CPU 2, and an A/D (analog-to-digital) converter 8 for converting analog signals to digital signals.
It should be understood that the term “user” of a microcomputer is used herein to signify an individual or company responsible for preparing an application program that will be executed by the microcomputer.
A user generates an application program beforehand, and stores this in the ROM 3 of the microcomputer 1. Thereafter, each time operation of the microcomputer is started, the CPU 2 reads out the contents of the program stored in the ROM 3, and performs processing accordingly to control a controlled apparatus.
With such a control microcomputer, the CPU 2 must execute various initialization operations before actually beginning to control the controlled apparatus by means of an application program that has been generated by the user. In the prior art, such initialization processing is performed through initialization routines and/or a program module, generated by the user and located at the head of the overall program, i.e., immediately prior to the start of the application program. However the initialization processing includes portions which, for the same type of microcomputer, are always the same, irrespective of the contents of the user application. In addition such parts of the initialization processing include portions which, if not correctly generated and stored in the ROM 3, may result in unreliable operation of the microcomputer 1. For that reason, preparation of such a program module or initialization processing routines, as part of a program that is prepared by a user, constitutes a substantial burden on the user.